<?php

namespace Xin\ChatGPT;

use Psr\Http\Message\ResponseInterface;

class ResponseUtil
{
    /**
     * @param ResponseInterface $response
     * @return array
     */
    public static function toArray(ResponseInterface $response)
    {
        $response = $response->getBody()->getContents();
        return json_decode($response, true);
    }
}
